<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>导入客户管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
            $("#btnExport").click(function(){
                top.$.jBox.confirm("确认要导出报警用户数据吗？","系统提示",function(v,h,f){
                    if(v=="ok"){
                        $("#searchForm").attr("action","${ctx}/sys/customer/customer/export");
                        $("#searchForm").submit();
                    }
                },{buttonsFocus:1});
                top.$('.jbox-body .jbox-icon').css('top','55px');
            });
            $("#btnImport").click(function(){
                $.jBox($("#importBox").html(), {title:"导入数据", buttons:{"关闭":true},
                    bottomText:"导入文件不能超过5M，仅允许导入“xls”或“xlsx”格式文件！"});
            });
            $("#btnRestat").click(function () {
				$("#liId").val("");
				$("#name").val("");
				$("#btnSubmit").click();
            })
            $(".tbxx").click(function () {
                var id = $(this).data("id");
                layer.open({
                    type: 2,
                    title:"备注信息查看",
                    skin: 'layui-layer-rim', //加上边框
                    offset: ['50px', '100px'],
                    area: ['800px', '60%'], //宽高
                    content: "${ctx}/sys/customer/customer/sbzd?id="+id
                });
            })
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
            $("#searchForm").attr("action","${ctx}/sys/customer/customer/");
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<div id="importBox" class="hide">
		<form id="importForm" action="${ctx}/sys/customer/customer/import" method="post" enctype="multipart/form-data"
			  class="form-search" style="padding-left:20px;text-align:center;" onsubmit="loading('正在导入，请稍等...');"><br/>
			<input id="uploadFile" name="file" type="file" style="width:330px"/><br/><br/>　　
			<input id="btnImportSubmit" class="btn btn-primary" type="submit" value="   导    入   "/>
			<a href="${ctx}/sys/customer/customer/import/template">下载模板</a>
		</form>
	</div>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/sys/customer/customer/">导入客户列表</a></li>
		<shiro:hasPermission name="sys:customer:customer:edit"><li><a href="${ctx}/sys/customer/customer/form">客户添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="customer" action="${ctx}/sys/customer/customer/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>理赔编号：</label>
				<form:input path="liId" htmlEscape="false" maxlength="255" class="input-medium"/>
			</li>
			<li><label>客户姓名：</label>
				<form:input path="name" htmlEscape="false" maxlength="255" class="input-medium"/>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"  onclick="return page();"/>
				<input id="btnRestat" class="btn btn-primary" type="button" value="重置"/>
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<%--<input id="btnExport" class="btn btn-primary" type="button" value="导出"/>--%>
					<%--<button  id="btnExport" class="layui-btn layui-btn-radius layui-btn-warm">导出</button>--%>
				<input id="btnImport" class="btn btn-primary" type="button" value="导入"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>理赔编号</th>
				<th>客户姓名</th>
				<th>性别</th>
				<th>理赔类型</th>
				<th>事件性质</th>
				<th>发生日期</th>
				<th>身故日期</th>
				<th>重大疾病日期</th>
				<th>鉴定日期</th>
				<th>报案日期</th>
				<th>受理日期</th>
				<th>机构</th>
				<th>当前作业人员</th>
				<th>长险/短险</th>
				<th>案件状态</th>
				<th>地区</th>
				<th>备注信息</th>
				<shiro:hasPermission name="sys:customer:customer:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="customer">
			<tr>
				<td><a href="${ctx}/sys/customer/customer/form?id=${customer.id}">
					${customer.liId}
				</a></td>
				<td><a href="${ctx}/sys/customer/customer/form?id=${customer.id}">
					${customer.name}
				</a></td>
				<td>
					${fns:getDictLabel(customer.sex, 'sex', '')}
				</td>
				<td>
                <c:choose>
					<c:when test="${customer.liLeixing =='1'|| customer.liLeixing =='2'|| customer.liLeixing =='3'|| customer.liLeixing =='4'|| customer.liLeixing =='5'|| customer.liLeixing =='6'|| customer.liLeixing =='7'}">
					${fns:getDictLabel(customer.liLeixing, 'sq_lei', '')}
					</c:when>
					<c:otherwise>
						${customer.liLeixing}
					</c:otherwise>
				</c:choose>

				</td>
				<td>
					${customer.xinZhi}
				</td>
				<td>
					<fmt:formatDate value="${customer.fsTime}" pattern="yyyy-MM-dd"/>
				</td>
				<td>
					<fmt:formatDate value="${customer.sgTime}" pattern="yyyy-MM-dd"/>
				</td>
				<td>
					<fmt:formatDate value="${customer.zdTime}" pattern="yyyy-MM-dd"/>
				</td>
				<td>
					<fmt:formatDate value="${customer.jdTime}" pattern="yyyy-MM-dd"/>
				</td>
				<td>
					<fmt:formatDate value="${customer.baTime}" pattern="yyyy-MM-dd"/>
				</td>
				<td>
					<fmt:formatDate value="${customer.slTime}" pattern="yyyy-MM-dd"/>
				</td>
				<td>
					${customer.jg}
				</td>
				<td>
					${customer.person}
				</td>
				<td>
					${customer.changDuan}
				</td>
				<td>
					${customer.zhuang}
				</td>
				<td>
					${customer.dqName}
				</td>
				<td>
					<a href="#" href="javascript:void(0)" class="tbxx" data-id=${customer.id}>
						<div style="white-space: nowrap;overflow:hidden;width:80px;height: 20px;">
								${customer.remarks}
						</div></a>

				</td>
				<shiro:hasPermission name="sys:customer:customer:edit"><td>
    				<a href="${ctx}/sys/customer/customer/form?id=${customer.id}">修改</a>
				<shiro:hasPermission name="sys:customer:customer:del">
					<a href="${ctx}/sys/customer/customer/delete?id=${customer.id}" onclick="return confirmx('确认要删除该导入客户吗？', this.href)">删除</a>
				</shiro:hasPermission>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>